import { RouteRecordRaw } from 'vue-router';
import {
  HomePage,
  LayoutView,
  LoginPage,
  NotFoundPage404,
  RouteNameEnum, RouteUrlEnum
} from '@/config/router_config/router_components';

// 静态路由，也即公共路由模块
export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: RouteUrlEnum.appMain,
    component: LayoutView,
    redirect: { name: RouteNameEnum.homePage },
    children: [
      {
        path: RouteUrlEnum.homePage,
        component: HomePage,
        name: RouteNameEnum.homePage,
        meta: {
          title: '首页',
          hidden: false
        }
      }
    ]
  },
  {
    path: RouteUrlEnum.login,
    component: LoginPage,
    name: RouteNameEnum.login,
    meta: {
      hidden: true
    }
  },
  {
    path: RouteUrlEnum.page404,
    component: NotFoundPage404,
    name: RouteNameEnum.page404,
    meta: {
      hidden: true
    }
  },
  {
    path: '/:pathMatch(.*)',
    redirect: { name: RouteNameEnum.page404 },
    meta: {
      hidden: true
    }
  }
];
